﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Manage.ascx.cs" Inherits="ZkSurvey.Web.VP.SurveyMgr.Manage" %>
<tbwc:StyleSheetControl ID="SscList" runat="server" CssPath="list.css">
</tbwc:StyleSheetControl>
<tbwc:StyleSheetControl ID="SscEdit" runat="server" CssPath="VP/SurveyMgr/Manage.css">
</tbwc:StyleSheetControl>
<tbwc:StyleSheetControl ID="SscDatePickerdd" runat="server" CssPath="DatePicker/datepicker.css">
</tbwc:StyleSheetControl>
<tbwc:StyleSheetControl ID="SscModal" runat="server" CssPath="modaldialogs.css">
</tbwc:StyleSheetControl>
<ajaxToolKit:ToolkitScriptManager runat="Server" EnablePartialRendering="true" CombineScripts="false"
    ID="ScriptManager1">
    <Scripts>
        <asp:ScriptReference Path="~/js/jquery-1.4.2.js" />
    </Scripts>
</ajaxToolKit:ToolkitScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
        <div id="relatedoperation">
            <div style="float: right;">
                <asp:LinkButton ID="LBtnNewSurvey" runat="server" CssClass="op">新建问卷</asp:LinkButton>
                <%--  <a id="LinkNewSurvey" href="#" class="op">新建问卷</a>--%>
                <%--<asp:LinkButton ID="LBtnSearch" runat="server" CssClass="op">搜索</asp:LinkButton>--%>
            </div>
            <asp:Literal ID="ltrSvCountInfo" runat="server"></asp:Literal>
        </div>
        <div class="dataListArea">
            <tbwc:GridViewEx ID="GvList" runat="server" SkinID="List" AllowPaging="true" PageSize="20"
                OnRowDataBound="GvList_RowDataBound" OnPageIndexChanging="GvList_PageIndexChanging"
                OnRowCommand="GvList_RowCommand">
                <EmptyDataTemplate>
                    还没有问卷（这个设置没有起作用？）
                </EmptyDataTemplate>
                <Columns>
                    <asp:TemplateField HeaderText="No.">
                        <ItemStyle CssClass="listNo" />
                        <ItemTemplate>
                            <asp:Literal ID="LtrNo" runat="server"></asp:Literal></ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="问卷标题">
                        <ItemTemplate>
                            <asp:HyperLink ID="HlExtView" ToolTip="外部用户访问的链接地址" Target="_blank" Text='<%#Eval("Title")%> '
                                runat="server"></asp:HyperLink>
                        </ItemTemplate>
                        <ItemStyle CssClass="title" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="开始时间">
                        <ItemTemplate>
                            <%# Convert.ToDateTime(( Eval("StartTime"))).ToString("yyyy-MM-dd") %>
                        </ItemTemplate>
                        <ItemStyle CssClass="time" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="结束时间">
                        <ItemTemplate>
                            <%#Convert.ToDateTime(( Eval("EndTime"))).ToString("yyyy-MM-dd")%>
                        </ItemTemplate>
                        <ItemStyle CssClass="time" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="创建人">
                        <ItemTemplate>
                            <%#Eval("Creator") %>
                        </ItemTemplate>
                        <ItemStyle CssClass="creator" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="创建时间">
                        <ItemTemplate>
                            <%#Convert.ToDateTime((Eval("CreateTime"))).ToString("yyyy-MM-dd")%>
                        </ItemTemplate>
                        <ItemStyle CssClass="time" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="状态">
                        <ItemTemplate>
                            <%#Eval("StatusTitle") %>
                        </ItemTemplate>
                        <ItemStyle CssClass="status" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="">
                        <ItemTemplate>
                            <asp:HyperLink ID="HlEdit" Target="_blank" runat="server" Text="编辑"></asp:HyperLink>
                            <asp:HyperLink ID="HlView" Target="_blank" runat="server" Text="预览"></asp:HyperLink>
                        </ItemTemplate>
                        <ItemStyle CssClass="ListOp" />
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="">
                        <ItemTemplate>
                            <asp:LinkButton ID="LBtnDelete" runat="server" Text="删除" OnClientClick='return confirm("确定要删除这个问卷吗？");'
                                CommandName="DeleteSv" CommandArgument='<%#Eval("Id") %>' CausesValidation="false"></asp:LinkButton>
                        </ItemTemplate>
                        <ItemStyle CssClass="ListOpDelete" />
                    </asp:TemplateField>
                </Columns>
            </tbwc:GridViewEx>
        </div>
        <ajaxToolKit:ModalPopupExtender ID="MpeNewSurvey" runat="server" TargetControlID="LBtnNewSurvey"
            PopupControlID="PnlNewSurvey" CancelControlID="BtnCancelNewSurvey" BackgroundCssClass="modalBackground"
            PopupDragHandleControlID="PnlNewSurveyCaption" Drag="false">
        </ajaxToolKit:ModalPopupExtender>
        <asp:Panel ID="PnlNewSurvey" runat="server" CssClass="modalBox" Style="display: none;"
            Width="500px">
            <asp:Panel ID="PnlNewSurveyCaption" runat="server" CssClass="caption" Style="margin-bottom: 10px;
                cursor: hand;">
                创建问卷
            </asp:Panel>
            <fieldset>
                <div>
                    <asp:Label ID="LblTitle" runat="server" AssociatedControlID="tbxTitle" Text="问卷标题:"
                        CssClass="add"></asp:Label><asp:TextBox ID="tbxTitle" runat="server" Width="25em"
                            MaxLength="200"></asp:TextBox><asp:RequiredFieldValidator ID="rfvTitle" runat="server"
                                ErrorMessage="(必填)" Display="Dynamic" ControlToValidate="tbxTitle" ValidationGroup="NewSurvey"></asp:RequiredFieldValidator></div>
                <div>
                    <asp:Label ID="LblDescription" runat="server" AssociatedControlID="tbxDescription"
                        Text="问卷说明:" CssClass="add"></asp:Label><asp:TextBox ID="tbxDescription" runat="server"
                            Width="25em" TextMode="MultiLine" Rows="5" MaxLength="200"></asp:TextBox><asp:RequiredFieldValidator
                                ID="RfvTitleVer" runat="server" ErrorMessage="(必填)" Display="Dynamic" ControlToValidate="tbxDescription"
                                ValidationGroup="NewSurvey"></asp:RequiredFieldValidator></div>
                <div>
                    <asp:Label ID="LblStartTime" runat="server" AssociatedControlID="tbxStartTime" Text="开始时间:"
                        CssClass="add"></asp:Label>
                    <tbwc:DatePicker ID="tbxStartTime" Width="10em" runat="server" Value="" EnableTheming="true" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="(必填)"
                        Display="Dynamic" ControlToValidate="tbxStartTime" ValidationGroup="NewSurvey"></asp:RequiredFieldValidator>
                </div>
                <div>
                    <asp:Label ID="LblEndTime" runat="server" AssociatedControlID="tbxEndTime" Text="结束时间:"
                        CssClass="add"></asp:Label>
                    <tbwc:DatePicker ID="tbxEndTime" Width="10em" runat="server" Value="" EnableTheming="true" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="(必填)"
                        Display="Dynamic" ControlToValidate="tbxEndTime" ValidationGroup="NewSurvey"></asp:RequiredFieldValidator>
                </div>
                <%--<div>
                    <asp:Label ID="LblValidationCode" runat="server" AssociatedControlID="tbxValidationCode"
                        Text="验证码:" CssClass="add"></asp:Label><asp:TextBox ID="tbxValidationCode" runat="server"
                            Width="25em"></asp:TextBox><asp:RequiredFieldValidator ID="RequiredFieldValidator3"
                                runat="server" ErrorMessage="(必填)" Display="Dynamic" ControlToValidate="tbxValidationCode"
                                ValidationGroup="NewSurvey"></asp:RequiredFieldValidator></div>--%>
                <div style="white-space: nowrap; text-align: center; margin-top: 2em;">
                    <asp:Button ID="BtnSaveNewSurvey" runat="server" Text="创建" ValidationGroup="NewSurvey"
                        OnClick="BtnSaveNewSurvey_Click" />
                    <asp:Button ID="BtnCancelNewSurvey" runat="server" Text="取消" />
                </div>
            </fieldset>
        </asp:Panel>
    </ContentTemplate>
    <Triggers>
    </Triggers>
</asp:UpdatePanel>
